]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Remove the queue updated ID for completed drags as well
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 11 Sep 2013 19:09:09 +0000 (15:09 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 11 Sep 2013 19:11:23 +0000 (15:11 -0400)
I thought that cancelDrag was called for completed drags as well,
but it's not. Move the updateHoverId source removal to dragComplete.

This fixes "this._dragActor is undefined" warnings after completed
drags.

https://bugzilla.gnome.org/show_bug.cgi?id=707935

js/ui/dnd.js

index 411a1d6ca38031202a8c5521c163a29db31422cf..6752eb32d42c05dc9ae13c046e44f2a3fc822fcb 100644 (file)
@@ -517,11 +517,6 @@ const _Draggable = new Lang.Class({
     },
 
     _cancelDrag: function(eventTime) {
-        if (this._updateHoverId) {
-            GLib.source_remove(this._updateHoverId);
-            this._updateHoverId = 0;
-        }
-
         this.emit('drag-cancelled', eventTime);
         this._dragInProgress = false;
         let [snapBackX, snapBackY, snapBackScale] = this._getRestoreLocation();
@@ -617,6 +612,11 @@ const _Draggable = new Lang.Class({
             this._lastEnterActor = null;
         }
 
+        if (this._updateHoverId) {
+            GLib.source_remove(this._updateHoverId);
+            this._updateHoverId = 0;
+        }
+
         this._dragActor = undefined;
         currentDraggable = null;
     }